/**
 * This input is a small state machine. The state machine is:
 * 
 */
$('#id-smart-input').die('keypress').live('keypress', function(e) {

	// Input character in this position
	dynamicComboPositionLeft = this.selectionStart;

	switch (e.which) {
	case SHARP:
		eventSharp($(this), e);
		break;
	case DOT:
		eventDot($(this), e);
		break;
	case SPACE:
		eventSpace($(this), e);
		break;
	case BACKSPACE:
		eventBackspace($(this), e);
		break;
	case KEY_CODE:
		eventKeyCode($(this), e);
		break;
	case ENTER:
		return eventEnter($(this), e);
	case EXCLAMATION:
		return eventExclamation($(this), e);
	default:
		eventDefaultState($(this), e);
		return;
	}

	lastState = e.which;
});